#include "vroute_stack_filter_outDisp_inner.hpp"
#include "vroute_tools.hpp"
#include "logger.hpp"

#include "vroute_dataIPC_protocol.hpp"
#include "stackProtocol.hpp"
#include "vrouteErrors.hpp"
#include "vroute_IPC.h"

namespace vroute_stack
{
    CFltOutInner::CFltOutInner()
    {
        m_prtlink = new CProtocolHeader();
        m_ipc = new CProtIPC();
        m_ipcdata = CIPC::getInstance();
    }

    CFltOutInner::~CFltOutInner()
    {
        ReleaseInsMaic(m_ipc)
        ReleaseInsMaic(m_prtlink)
    }
    int CFltOutInner::dofilter(char* content, int len, int index)
    {
        char* datas = m_prtlink->getData(content);
        int datalen = m_prtlink->getDataLength(content);
        int port = *(short*)datas;
        NodeAddr src = m_prtlink->getSource(content);
        memcpy(datas-4, src.caddr, 4);
        datalen += 4;
        return m_ipcdata->sendDataToAgent(datas, datalen, port);
    }
}
